/**
 *
 * @param {object} req
 * @returns {null|*|string}
 */
function getClientIP(req) {
  try {
    return req.headers['x-forwarded-for'] ||
        req.connection.remoteAddress ||
        req.socket.remoteAddress ||
        req.connection.socket.remoteAddress;
  } catch (error) {
    return null
  }
}
module.exports=getClientIP
